<style>
    .layui-form-item .layui-input-company {width: auto;padding-right: 10px;line-height: 38px;}
</style>
<div class="layuimini-container layuimini-page-anim">
    <div class="layuimini-main">

        <div class="layui-form layuimini-form">
            <div class="layui-form-item">
                <label class="layui-form-label required">网站名称</label>
                <div class="layui-input-block">
                    <input type="text" name="sitename" value="{{.config.sitename}}" lay-verify="required" lay-reqtext="网站域名不能为空" placeholder="请输入网站名称"  class="layui-input">
                    <tip>填写自己部署网站的名称。</tip>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label required">网站域名</label>
                <div class="layui-input-block">
                    <input type="text" name="domain" value="{{.config.domain}}" lay-verify="required" lay-reqtext="网站域名不能为空" placeholder="请输入网站域名"  class="layui-input">
                </div>
            </div>

            <div class="layui-form-item layui-form-text">
                <label class="layui-form-label required">SEO标题</label>
                <div class="layui-input-block">
                    <textarea name="seo"  class="layui-textarea">{{.config.seo}}</textarea>
                </div>
            </div>
            <div class="layui-form-item layui-form-text">
                <label class="layui-form-label">SEO关键词</label>
                <div class="layui-input-block">
                    <textarea name="keywords"  class="layui-textarea" placeholder="多个关键词用英文状态 , 号分割">{{.config.keywords}}</textarea>
                </div>
            </div>
            <div class="layui-form-item layui-form-text">
                <label class="layui-form-label">SEO描述</label>
                <div class="layui-input-block">
                    <textarea name="description"  class="layui-textarea">{{.config.description}}</textarea>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label required">联系地址</label>
                <div class="layui-input-block">
                    <input type="text" name="address" value="{{.config.address}}"  placeholder="请输入地址"   class="layui-input">
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label required">联系电话</label>
                <div class="layui-input-block">
                    <input type="text" name="phone" value="{{.config.phone}}"  placeholder="请输入电话"   class="layui-input">
                </div>
            </div>

            <div class="layui-form-item layui-form-text">
                <label class="layui-form-label required">版权信息</label>
                <div class="layui-input-block">
                    <textarea name="copyright"  class="layui-textarea">{{.config.copyright}}</textarea>
                </div>
            </div>

            <div class="layui-form-item layui-form-text">
                <label class="layui-form-label required">网站备案号</label>
                <div class="layui-input-block">
                    <textarea name="icp"  class="layui-textarea">{{.config.icp}}</textarea>
                </div>
            </div>

            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn layui-btn-normal" lay-submit lay-filter="setting">确认保存</button>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    layui.use(['form'], function () {
        var form = layui.form
            , layer = layui.layer;

        /**
         * 初始化表单，要加上，不然刷新部分组件可能会不加载
         */
        form.render();

        //监听提交
        form.on('submit(setting)', function (data) {
            //获取
            ajaxs("/sys/UpdateSet",data.field,function(res){
                layer.msg(res["Msg"], function () {
                    layer.closeAll()
                });
            },function(res){
                layer.msg(res["Msg"]);
            })
        });

    });
</script>